const path = require("path");

const resolve = dir => path.join(__dirname, dir);

const BASE_URL =
  // process.env.NODE_ENV === "生产环境" ? "/项目路径/" : "/";
  process.env.NODE_ENV === "production" ? "/static/share/" : "/";
module.exports = {
  lintOnSave: false,
  publicPath: BASE_URL,
  outputDir: "taget",
  chainWebpack: config => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("_c", resolve("src/components"))
      .set("_a", resolve("src/assets"));
  },
  /* 开发跨域 */
  devServer: {
    proxy: "https://www.yuedianapp.com"
    /* proxy: {
      "/api": {
        target: "http://www.doutieba.com/",
        // 将主机头的原点更改为目标URL
        changeOrigin: true,
        // 如果您想代理websockets
        // ws:true,
        pathRewrite: {
          "^/api": "/" //路径重写
        }
      }
    } */
  }
};
